package wzj.mybatisplusdemo.web.advice;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import wzj.mybatisplusdemo.web.dto.RespEntity;

@ControllerAdvice
public class ExceptionAdvice {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public RespEntity handleException(Exception e){
        e.printStackTrace();
        return new RespEntity("5000","服务器异常"+e.getMessage(),null);
    }
}
